//导入数据库模块
const mysql = require('../db/index')
//获取用户信息
exports.userinfo = (req,res)=>{
    const sql = 'select * from employee left join dept on employee.did = dept.did where eid = ?'
    mysql.query(sql,req.user.eid,(err,result)=>{
        if (err)return res.cc(err)
        if (result.length != 1) return res.cc('获取用户信息失败')
        res.send({status:0,message:'获取信息成功',data:result[0]})
    })
}